/**
 * 流程图存储对象
 * @returns
 */
function BkfmWorkFlowConfig(){
	var bkfmWorkFlowConfig = new Map();
	bkfmWorkFlowConfig.set("RWID",Utils.getRwid());
	//流程编码
	bkfmWorkFlowConfig.set("WORKFLOW_CODE",null);
	//流程名称
	bkfmWorkFlowConfig.set("WORKFLOW_NAME",null);
	//流程图配置文件
	bkfmWorkFlowConfig.set("WORKFLOW_XML_CONFIG",null);
	//流程状态，默认有效
	bkfmWorkFlowConfig.set("WORKFLOW_STATUS","Y");
	//初始化工作流节点列表
	bkfmWorkFlowConfig.set("WORKFLOW_NODES",new BkfmWorkFlowNodes());
	//设置工作流连接线列表
	bkfmWorkFlowConfig.set("WORKFLOW_LINES",new BkfmWorkFlowLines());
	
	this.bkfmWorkFlowConfig = bkfmWorkFlowConfig;
};
BkfmWorkFlowConfig.prototype.getRwid = function(){
	return this.bkfmWorkFlowConfig.get("RWID");
}
BkfmWorkFlowConfig.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowConfig.set("RWID",rwid);
}
/**
 * 获取流程编码
 */
BkfmWorkFlowConfig.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowConfig.get("WORKFLOW_CODE");
};
/**
 * 设置流程编码
 */
BkfmWorkFlowConfig.prototype.setWorkFlowCode = function(workFlowCode){
	this.bkfmWorkFlowConfig.set("WORKFLOW_CODE",workFlowCode);
};
/**
 * 获取流程名称
 */
BkfmWorkFlowConfig.prototype.getWorkFlowName = function(){
	return this.bkfmWorkFlowConfig.get("WORKFLOW_NAME");
};
/**
 * 设置流程名称
 */
BkfmWorkFlowConfig.prototype.setWorkFlowName = function(workFlowName){
	this.bkfmWorkFlowConfig.set("WORKFLOW_NAME",workFlowName);
};
/**
 * 获取流程图解析文件
 */
BkfmWorkFlowConfig.prototype.getWorkFlowXmlConfig = function(){
	return this.bkfmWorkFlowConfig.get("WORKFLOW_XML_CONFIG");
};
/**
 * 设置流程图解析文件
 */
BkfmWorkFlowConfig.prototype.setWorkFlowXmlConfig = function(workFlowXmlConfig){
	this.bkfmWorkFlowConfig.set("WORKFLOW_XML_CONFIG",workFlowXmlConfig);
};
/**
 * 获取流程图状态
 */
BkfmWorkFlowConfig.prototype.getWorkFlowStatus = function(){
	return this.bkfmWorkFlowConfig.get("WORKFLOW_STATUS");	
};
/**
 * 设置流程图状态
 * param workFlowStatus 流程状态Y/N
 */
BkfmWorkFlowConfig.prototype.setWorkFlowStatus = function(workFlowStatus){
	this.bkfmWorkFlowConfig.set("WORKFLOW_STATUS",workFlowStatus);
};
/**
 * 获取工作流节点列表
 */
BkfmWorkFlowConfig.prototype.getWorkFlowNodes = function(){
	return this.bkfmWorkFlowConfig.get("WORKFLOW_NODES");
}
/**
 * 设置工作流节点列表
 */
BkfmWorkFlowConfig.prototype.setWorkFlowNodes = function(workflow_nodes){
	return this.bkfmWorkFlowConfig.set("WORKFLOW_NODES",workflow_nodes);
}
/**
 * 获取工作流连接线列表
 */
BkfmWorkFlowConfig.prototype.getWorkFlowLines = function(){
	return this.bkfmWorkFlowConfig.get("WORKFLOW_LINES");
}
/**
 * 设置工作流连接线列表
 */
BkfmWorkFlowConfig.prototype.setWorkFlowLine = function(workflow_lines){
	return this.bkfmWorkFlowConfig.set("WORKFLOW_LINES",workflow_lines);
}





/**
 * 流程节点列表
 * @returns
 */
function BkfmWorkFlowNodes(){
	var bkfmWorkFlowNodes = new Array();
	this.bkfmWorkFlowNodes = bkfmWorkFlowNodes;
}

BkfmWorkFlowNodes.prototype.getBkfmWorkFlowNodes = function(){
	return this.bkfmWorkFlowNodes;
}
BkfmWorkFlowNodes.prototype.addBkfmWorkFlowNode = function(bkfmWorkFlowNode){
	this.bkfmWorkFlowNodes.push(bkfmWorkFlowNode);
}
BkfmWorkFlowNodes.prototype.getBkfmWorkFlowNode = function(node_code){
	for(i in this.bkfmWorkFlowNodes){
		var bkfmWorkFlowNode = this.bkfmWorkFlowNodes[i];
		if(node_code == bkfmWorkFlowNode.getNodeCode()){
			return bkfmWorkFlowNode;
		}
	}
	return null;
}
BkfmWorkFlowNodes.prototype.setBkfmWorkFlowNode = function(bkfmWorkFlowNode){
	for(i in this.bkfmWorkFlowNodes){
		var oldBkfmWorkFlowNode = this.bkfmWorkFlowNodes[i];
		if(oldBkfmWorkFlowNode.getNodeCode() == bkfmWorkFlowNode.getNodeCode()){
			this.bkfmWorkFlowNodes[i] = bkfmWorkFlowNode;
			break;
		}
	}
}
BkfmWorkFlowNodes.prototype.removeBkfmWorkFlowNode = function(bkfmWorkFlowNode){
	for(i in this.bkfmWorkFlowNodes){
		var oldBkfmWorkFlowNode = this.bkfmWorkFlowNodes[i];
		if(oldBkfmWorkFlowNode.getNodeCode() == bkfmWorkFlowNode.getNodeCode()){
			this.bkfmWorkFlowNodes.splice(i,1);
			break;
		}
	}
}

/**
 * 流程节点
 * @returns
 */
function BkfmWorkFlowNode(){
	var bkfmWorkFlowNode = new Map();
	bkfmWorkFlowNode.set("RWID",Utils.getRwid());
	//节点编码
	bkfmWorkFlowNode.set("NODE_CODE",null);
	//节点名称
	bkfmWorkFlowNode.set("NODE_NAME",null);
	//所属流程编码
	bkfmWorkFlowNode.set("WORKFLOW_CODE",null);
	//坐标
	bkfmWorkFlowNode.set("NODE_POINTS",null);
	//节点类型
	bkfmWorkFlowNode.set("NODE_TYPE",null);
	//审批or启动权限
	bkfmWorkFlowNode.set("APPROVAL_PERMIS",null);
	//审批前操作
	bkfmWorkFlowNode.set("BEFOREACTIONHANDLER",null);
	//审批后操作
	bkfmWorkFlowNode.set("AFTERACTIONHANDLER",null);
	//节点对应查看表单名称
	bkfmWorkFlowNode.set("NODE_FORM_NAME",null);
	//设置节点对应人员权限
	bkfmWorkFlowNode.set("PERMIS_USERS",new BkfmWorkFlowNodePermisUsers());
	//设置节点对应角色权限
	bkfmWorkFlowNode.set("PERMIS_ROLES",new BkfmWorkFlowNodePermisRoles());
	//设置节点对应部门权限
	bkfmWorkFlowNode.set("PERMIS_DEPTS",new BkfmWorkFlowNodePermisDepts());
	//
	
	this.bkfmWorkFlowNode = bkfmWorkFlowNode;
}
//审批权限所有人
BkfmWorkFlowNode.prototype.APPROVAL_PERMIS_ALL_USER_CODE = "ALL_USER";
BkfmWorkFlowNode.prototype.APPROVAL_PERMIS_ALL_USER_NAME = "所有人";
//审批权限指定人
BkfmWorkFlowNode.prototype.APPROVAL_PERMIS_APPOINT_PERMIS_CODE = "APPOINT_PERMIS";
BkfmWorkFlowNode.prototype.APPROVAL_PERMIS_APPOINT_PERMIS_NAME = "指定人";
//申请人
BkfmWorkFlowNode.prototype.APPROVAL_PERMIS_APPLY_USER_CODE = "APPLY_USER";
BkfmWorkFlowNode.prototype.APPROVAL_PERMIS_APPLY_USER_NAME = "申请人";

BkfmWorkFlowNode.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNode.set("RWID",rwid);
}
BkfmWorkFlowNode.prototype.getRwid = function(){
	return this.bkfmWorkFlowNode.get("RWID");
}
BkfmWorkFlowNode.prototype.getNodeCode = function(){
	return this.bkfmWorkFlowNode.get("NODE_CODE");
}
BkfmWorkFlowNode.prototype.setNodeCode = function(node_code){
	this.bkfmWorkFlowNode.set("NODE_CODE",node_code);
}

BkfmWorkFlowNode.prototype.getNodeName = function(){
	return this.bkfmWorkFlowNode.get("NODE_NAME");
}
BkfmWorkFlowNode.prototype.setNodeName = function(node_name){
	this.bkfmWorkFlowNode.set("NODE_NAME",node_name);
}

BkfmWorkFlowNode.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNode.get("WORKFLOW_CODE");
}
BkfmWorkFlowNode.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNode.set("WORKFLOW_CODE",workflow_code);
}

BkfmWorkFlowNode.prototype.getNodePoints  = function(){
	return this.bkfmWorkFlowNode.get("NODE_POINTS");
}
BkfmWorkFlowNode.prototype.setNodePoints = function(node_points){
	this.bkfmWorkFlowNode.set("NODE_POINTS",node_points);
}

BkfmWorkFlowNode.prototype.getNodeType = function(){
	return this.bkfmWorkFlowNode.get("NODE_TYPE");
}
BkfmWorkFlowNode.prototype.setNodeType = function(node_type){
	this.bkfmWorkFlowNode.set("NODE_TYPE",node_type);
}

BkfmWorkFlowNode.prototype.setApprovalPermis = function(approval_permis){
	this.bkfmWorkFlowNode.set("APPROVAL_PERMIS",approval_permis);
}
BkfmWorkFlowNode.prototype.getApprovalPermis = function(){
	return this.bkfmWorkFlowNode.get("APPROVAL_PERMIS");
}

BkfmWorkFlowNode.prototype.setBeforeActionHandler = function(beforeactionhandler){
	this.bkfmWorkFlowNode.set("BEFOREACTIONHANDLER",beforeactionhandler);
}
BkfmWorkFlowNode.prototype.getBeforeActionHandler = function(){
	return this.bkfmWorkFlowNode.get("BEFOREACTIONHANDLER");
}

BkfmWorkFlowNode.prototype.setAfterActionHandler = function(afteractionhandler){
	this.bkfmWorkFlowNode.set("AFTERACTIONHANDLER",afteractionhandler);
}
BkfmWorkFlowNode.prototype.getAfterActionHandler = function(){
	return this.bkfmWorkFlowNode.get("AFTERACTIONHANDLER");
}

BkfmWorkFlowNode.prototype.getNodeFormName = function(){
	return this.bkfmWorkFlowNode.get("NODE_FORM_NAME");
}
BkfmWorkFlowNode.prototype.setNodeFormName = function(node_form_name){
	this.bkfmWorkFlowNode.set("NODE_FORM_NAME",node_form_name);
}
/**
 * 设置节点用户权限
 */
BkfmWorkFlowNode.prototype.setPermisUsers = function(permis_users){
	this.bkfmWorkFlowNode.set("PERMIS_USERS",permis_users);
}
/**
 * 获取节点用户权限
 */
BkfmWorkFlowNode.prototype.getPermisUsers = function(){
	return this.bkfmWorkFlowNode.get("PERMIS_USERS");
}
/**
 * 设置节点角色权限
 */
BkfmWorkFlowNode.prototype.setPermisRoles = function(permis_roles){
	this.bkfmWorkFlowNode.set("PERMIS_ROLES",permis_roles);
}
/**
 * 获取节点角色权限
 */
BkfmWorkFlowNode.prototype.getPermisRoles = function(){
	return this.bkfmWorkFlowNode.get("PERMIS_ROLES");
}
/**
 * 设置节点部门权限
 */
BkfmWorkFlowNode.prototype.setPermisDepts = function(permis_depts){
	this.bkfmWorkFlowNode.set("PERMIS_DEPTS",permis_depts);
}
/**
 * 获取节点部门权限
 */
BkfmWorkFlowNode.prototype.getPermisDepts = function(){
	return this.bkfmWorkFlowNode.get("PERMIS_DEPTS");
}




/**
 * 流程连接线列表
 * @returns
 */
function BkfmWorkFlowLines(){
	var bkfmWorkFlowLines = new Array();
	this.bkfmWorkFlowLines = bkfmWorkFlowLines;
}
/**
 * 获取连接线对象
 */
BkfmWorkFlowLines.prototype.getBkfmWorkFlowLines = function(){
	return this.bkfmWorkFlowLines;
}
/**
 * 新增连接线
 */
BkfmWorkFlowLines.prototype.addBkfmWorkFlowLine = function(bkfmWorkFlowLine){
	this.bkfmWorkFlowLines.push(bkfmWorkFlowLine);
}
/**
 * 获取单条连接线
 */
BkfmWorkFlowLines.prototype.getBkfmWorkFlowLine = function(action_code){
	for(i in this.bkfmWorkFlowLines){
		var bkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(action_code == bkfmWorkFlowLine.getActionCode()){
			return bkfmWorkFlowLine;
		}
	}
	return null;
}
/**
 * 获取以节点参数开始或者结束的所有的流程连接线
 * 根据节点编码获取该节点的所有开始或者结束的连接线
 */
BkfmWorkFlowLines.prototype.getBkfmWorkFlowNodeLinesByNodeCode = function(node_code){
	var wofkFlowLines = new BkfmWorkFlowLines();
	for(i in this.bkfmWorkFlowLines){
		var oldBkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(oldBkfmWorkFlowLine.getSourceNodeCode() == node_code || oldBkfmWorkFlowLine.getTargetNodeCode() == node_code){
			wofkFlowLines.addBkfmWorkFlowLine(oldBkfmWorkFlowLine);
		}
	}
	return wofkFlowLines;
}
/**
 * 获取以指定节点开始的连接线
 */
BkfmWorkFlowLines.prototype.getBkfmWorkFlowNodeStartLines = function(bkfmWorkFlowNode){
	var wofkFlowLines = new BkfmWorkFlowLines();
	for(i in this.bkfmWorkFlowLines){
		var oldBkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(oldBkfmWorkFlowLine.getSourceNodeCode() == bkfmWorkFlowNode.getNodeCode()){
			wofkFlowLines.addBkfmWorkFlowLine(oldBkfmWorkFlowLine);
		}
	}
	return wofkFlowLines;
}
/**
 * 获取以指定节点结束的连接线
 */
BkfmWorkFlowLines.prototype.getBkfmWorkFlowNodeEndLines = function(bkfmWorkFlowNode){
	var wofkFlowLines = new BkfmWorkFlowLines();
	for(i in this.bkfmWorkFlowLines){
		var oldBkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(oldBkfmWorkFlowLine.getTargetNodeCode() == bkfmWorkFlowNode.getNodeCode()){
			wofkFlowLines.addBkfmWorkFlowLine(oldBkfmWorkFlowLine);
		}
	}
	return wofkFlowLines;
}
/**
 * 设置连接线对象
 */
BkfmWorkFlowLines.prototype.setBkfmWorkFlowLine = function(bkfmWorkFlowLine){
	for(i in this.bkfmWorkFlowLines){
		var oldBkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(oldBkfmWorkFlowLine.getActionCode() == bkfmWorkFlowLine.getActionCode()){
			this.bkfmWorkFlowLines[i] = bkfmWorkFlowLine;
			break;
		}
	}
}
/**
 * 删除连接线
 */
BkfmWorkFlowLines.prototype.removeBkfmWorkFlowLine = function(bkfmWorkFlowLine){
	debugger;
	for(i in this.bkfmWorkFlowLines){
		var oldBkfmWorkFlowLine = this.bkfmWorkFlowLines[i];
		if(oldBkfmWorkFlowLine.getActionCode() == bkfmWorkFlowLine.getActionCode()){
			this.bkfmWorkFlowLines.splice(i,1);
			break;
		}
	}
}

/**
 * 流程节点动作,流程连接线节点
 * @returns
 */
function BkfmWorkFlowLine(){
	var bkfmWorkFlowLine = new Map();
	bkfmWorkFlowLine.set("RWID",Utils.getRwid());
	//原节点编码
	bkfmWorkFlowLine.set("SOURCENODE_CODE",null);
	//原节点名称
	bkfmWorkFlowLine.set("SOURCENODE_NAME",null);
	//流转条件
	bkfmWorkFlowLine.set("CONDITIONS",null);
	//动作节点编码,line_code/node_code/action_code
	bkfmWorkFlowLine.set("ACTION_CODE",null);
	//动作名称
	bkfmWorkFlowLine.set("ACTION_NAME",null);
	//目标节点编码
	bkfmWorkFlowLine.set("TARGETNODE_CODE",null);
	//目标节点名称
	bkfmWorkFlowLine.set("TARGETNODE_NAME",null);
	
	this.bkfmWorkFlowLine = bkfmWorkFlowLine;
}
BkfmWorkFlowLine.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowLine.set("RWID",rwid);
}
BkfmWorkFlowLine.prototype.getRwid = function(){
	return this.bkfmWorkFlowLine.get("RWID");
}
/**
 * 设置流程表对象唯一编码
 */
BkfmWorkFlowLine.prototype.getSourceNodeCode = function(){
	return this.bkfmWorkFlowLine.get("SOURCENODE_CODE");
}
BkfmWorkFlowLine.prototype.setSourceNodeCode = function(sourcenode_code){
	this.bkfmWorkFlowLine.set("SOURCENODE_CODE",sourcenode_code);
}
BkfmWorkFlowLine.prototype.getSourceNodeName = function(){
	return this.bkfmWorkFlowLine.get("SOURCENODE_NAME");
}
BkfmWorkFlowLine.prototype.setSourceNodeName = function(sourcenode_name){
	this.bkfmWorkFlowLine.set("SOURCENODE_NAME",sourcenode_name);
}
BkfmWorkFlowLine.prototype.getConditions = function(){
	return this.bkfmWorkFlowLine.get("CONDITIONS");
}
BkfmWorkFlowLine.prototype.setConditions = function(conditions){
	this.bkfmWorkFlowLine.set("CONDITIONS",conditions);
}
BkfmWorkFlowLine.prototype.getActionCode = function(){
	return this.bkfmWorkFlowLine.get("ACTION_CODE");
}
BkfmWorkFlowLine.prototype.setActionCode = function(action_code){
	this.bkfmWorkFlowLine.set("ACTION_CODE",action_code);
}
BkfmWorkFlowLine.prototype.getActionName = function(){
	return this.bkfmWorkFlowLine.get("ACTION_NAME");
}
BkfmWorkFlowLine.prototype.setActionName = function(action_name){
	this.bkfmWorkFlowLine.set("ACTION_NAME",action_name);
}
BkfmWorkFlowLine.prototype.getTargetNodeCode = function(){
	return this.bkfmWorkFlowLine.get("TARGETNODE_CODE");
}
BkfmWorkFlowLine.prototype.setTargetNodeCode = function(targetnode_code){
	this.bkfmWorkFlowLine.set("TARGETNODE_CODE",targetnode_code);
}
BkfmWorkFlowLine.prototype.getTagetNodeName = function(){
	return this.bkfmWorkFlowLine.get("TARGETNODE_NAME");
}
BkfmWorkFlowLine.prototype.setTargetNodeName = function(targetnode_name){
	this.bkfmWorkFlowLine.set("TARGETNODE_NAME",targetnode_name);
}


/**
 * 节点用户权限列表
 * @returns
 */
function BkfmWorkFlowNodePermisUsers(){
	var bkfmWorkFlowNodePermisUsers = new Array();
	this.bkfmWorkFlowNodePermisUsers = bkfmWorkFlowNodePermisUsers;
}
/**
 * 获取节点用户权限列表
 */
BkfmWorkFlowNodePermisUsers.prototype.getBkfmWorkFlowNodePermisUsers = function(){
	return this.bkfmWorkFlowNodePermisUsers;
}
/**
 * 根据节点编码获取节点对应的用户权限
 */
BkfmWorkFlowNodePermisUsers.prototype.getBkfmWorkFlowNodePermisUsersByNodeCode = function(node_code){
	var workFlowNodePermisUsers = new Array();
	this.bkfmWorkFlowNodePermisUsers.forEach(function (item,index,owner){
		if(item.getNodeCode() == node_code){
			workFlowNodePermisUsers.push(item);
		}
	});
	return workFlowNodePermisUsers;
}
/**
 * 添加节点用户到用户权限列表中
 */
BkfmWorkFlowNodePermisUsers.prototype.addBkfmWorkFlowNodePermisUser = function(bkfmWorkFlowNodePermisUser){
	this.bkfmWorkFlowNodePermisUsers.push(bkfmWorkFlowNodePermisUser);
}
/**
 * 判断需要添加的用户是否已经存在
 */
BkfmWorkFlowNodePermisUsers.prototype.hasExistsUser = function(user_no,node_code){
	var bool = false;
	this.bkfmWorkFlowNodePermisUsers.forEach(function (item,index,owner){
		if(item.getUserNo() == user_no && item.getNodeCode() == node_code){
			bool = true;
			return false;
		}
	});
	return bool;
}
/**
 * 根据用户编码和节点编码获取指定节点用户权限对象
 */
BkfmWorkFlowNodePermisUsers.prototype.getBkfmWorkFlowNodePermisUser = function(user_no,node_code){
	var bkfmWorkFlowNodePermisUser = null;
	this.bkfmWorkFlowNodePermisUsers.forEach(function (item,index,owner){
		if(item.getUserNo() == user_no && item.getNodeCode() == node_code){
			bkfmWorkFlowNodePermisUser = item;
			return false;
		}
	});
	return bkfmWorkFlowNodePermisUser;
}
/**
 * 根据用户编码删除用户权限对象
 */
BkfmWorkFlowNodePermisUsers.prototype.removeBkfmWorkFlowNodePermisUserByUserNo = function(user_no,node_code){
	for(i in this.bkfmWorkFlowNodePermisUsers){
		var oldBkfmWorkFlowNodePermisUsers = this.bkfmWorkFlowNodePermisUsers[i];
		if(oldBkfmWorkFlowNodePermisUsers.getUserNo() == user_no && oldBkfmWorkFlowNodePermisUsers.getNodeCode() == node_code){
			this.bkfmWorkFlowNodePermisUsers.splice(i,1);
			break;
		}
	}
}

/*流程节点人员权限对象*/
function BkfmWorkFlowNodePermisUser(){
	var bkfmWorkFlowNodePermisUser = new Map();
	bkfmWorkFlowNodePermisUser.set("RWID",Utils.getRwid());
	bkfmWorkFlowNodePermisUser.set("USER_NO",null);
	bkfmWorkFlowNodePermisUser.set("USER_NAME",null);
	bkfmWorkFlowNodePermisUser.set("NODE_CODE",null);
	bkfmWorkFlowNodePermisUser.set("NODE_NAME",null);
	bkfmWorkFlowNodePermisUser.set("WORKFLOW_CODE",null);
	bkfmWorkFlowNodePermisUser.set("WORKFLOW_NAME",null);
	
	this.bkfmWorkFlowNodePermisUser = bkfmWorkFlowNodePermisUser;
}
BkfmWorkFlowNodePermisUser.prototype.getRwid = function(){
	return this.bkfmWorkFlowNodePermisUser.get("RWID");
}
BkfmWorkFlowNodePermisUser.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNodePermisUser.set("RWID",rwid);
}
BkfmWorkFlowNodePermisUser.prototype.getUserNo = function(){
	return this.bkfmWorkFlowNodePermisUser.get("USER_NO");
}
BkfmWorkFlowNodePermisUser.prototype.setUserNo = function(user_no){
	this.bkfmWorkFlowNodePermisUser.set("USER_NO",user_no);
}
BkfmWorkFlowNodePermisUser.prototype.getUserName = function(){
	return this.bkfmWorkFlowNodePermisUser.get("USER_NAME")
}
BkfmWorkFlowNodePermisUser.prototype.setUserName = function(user_name){
	this.bkfmWorkFlowNodePermisUser.set("USER_NAME",user_name);
}
BkfmWorkFlowNodePermisUser.prototype.getNodeCode = function(){
	return this.bkfmWorkFlowNodePermisUser.get("NODE_CODE");
}
BkfmWorkFlowNodePermisUser.prototype.setNodeCode = function(node_code){
	this.bkfmWorkFlowNodePermisUser.set("NODE_CODE",node_code)
}
BkfmWorkFlowNodePermisUser.prototype.getNodeName = function(){
	return this.bkfmWorkFlowNodePermisUser.get("NODE_NAME");
}
BkfmWorkFlowNodePermisUser.prototype.setNodeName = function(node_name){
	this.bkfmWorkFlowNodePermisUser.set("NODE_NAME",node_name);
}
BkfmWorkFlowNodePermisUser.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNodePermisUser.get("WORKFLOW_CODE");
}
BkfmWorkFlowNodePermisUser.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNodePermisUser.set("WORKFLOW_CODE",workflow_code);
}
BkfmWorkFlowNodePermisUser.prototype.getWorkFlowName = function(){
	return this.bkfmWorkFlowNodePermisUser.get("WORKFLOW_NAME");
}
BkfmWorkFlowNodePermisUser.prototype.setWorkFlowName = function(workflow_name){
	this.bkfmWorkFlowNodePermisUser.set("WORKFLOW_NAME",workflow_name);
}

/**
 * 节点角色权限列表
 * @returns
 */
function BkfmWorkFlowNodePermisRoles(){
	var bkfmWorkFlowNodePermisRoles = new Array();
	this.bkfmWorkFlowNodePermisRoles = bkfmWorkFlowNodePermisRoles;
}
BkfmWorkFlowNodePermisRoles.prototype.getBkfmWorkFlowNodePermisRoles = function(){
	return this.bkfmWorkFlowNodePermisRoles;
}
/**
 * 根据节点编码获取节点对应的角色权限
 */
BkfmWorkFlowNodePermisRoles.prototype.getBkfmWorkFlowNodePermisRolesByNodeCode = function(node_code){
	var workFlowNodePermisRoles = new Array();
	this.bkfmWorkFlowNodePermisRoles.forEach(function (item,index,owner){
		if(item.getNodeCode() == node_code){
			workFlowNodePermisRoles.push(item);
		}
	});
	return workFlowNodePermisRoles;
}
/**
 * 添加节点角色到角色权限列表中
 */
BkfmWorkFlowNodePermisRoles.prototype.addBkfmWorkFlowNodePermisRole = function(bkfmWorkFlowNodePermisRole){
	this.bkfmWorkFlowNodePermisRoles.push(bkfmWorkFlowNodePermisRole);
}
/**
 * 判断需要添加的角色是否已经存在
 */
BkfmWorkFlowNodePermisRoles.prototype.hasExistsRole = function(role_id,node_code){
	var bool = false;
	this.bkfmWorkFlowNodePermisRoles.forEach(function (item,index,owner){
		if(item.getRoleId() == role_id && item.getNodeCode() == node_code){
			bool = true;
			return false;
		}
	});
	return bool;
}
/**
 * 根据角色编码和节点编码查询对应的角色权限对象
 */
BkfmWorkFlowNodePermisRoles.prototype.getBkfmWorkFlowNodePermisRole = function(role_id,node_code){
	var bkfmWorkFlowNodePermisRole = null;
	this.bkfmWorkFlowNodePermisRoles.forEach(function (item,index,owner){
		if(item.getRoleId() == role_id && item.getNodeCode() == node_code){
			bkfmWorkFlowNodePermisRole = item;
			return false;
		}
	});
	return bkfmWorkFlowNodePermisRole;
}
/**
 * 根据角色编码删除角色权限对象
 */
BkfmWorkFlowNodePermisRoles.prototype.removeBkfmWorkFlowNodePermisRole = function(role_id,node_code){
	for(i in this.bkfmWorkFlowNodePermisRoles){
		var oldBkfmWorkFlowNodePermisRole = this.bkfmWorkFlowNodePermisRoles[i];
		if(oldBkfmWorkFlowNodePermisRole.getRoleId() == role_id && oldBkfmWorkFlowNodePermisRole.getNodeCode() == node_code){
			this.bkfmWorkFlowNodePermisRoles.splice(i,1);
			break;
		}
	}
}
/*流程节点角色权限*/
function BkfmWorkFlowNodePermisRole(){
	var bkfmWorkFlowNodePermisRole = new Map();
	bkfmWorkFlowNodePermisRole.set("RWID",Utils.getRwid());
	bkfmWorkFlowNodePermisRole.set("ROLE_ID",null);
	bkfmWorkFlowNodePermisRole.set("ROLE_NAME",null);
	bkfmWorkFlowNodePermisRole.set("NODE_CODE",null);
	bkfmWorkFlowNodePermisRole.set("NODE_NAME",null);
	bkfmWorkFlowNodePermisRole.set("WORKFLOW_CODE",null);
	bkfmWorkFlowNodePermisRole.set("WORKFLOW_NAME",null);
	
	this.bkfmWorkFlowNodePermisRole = bkfmWorkFlowNodePermisRole;
}
BkfmWorkFlowNodePermisRole.prototype.getRwid = function(){
	return this.bkfmWorkFlowNodePermisRole.get("RWID");
}
BkfmWorkFlowNodePermisRole.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNodePermisRole.set("RWID",rwid);
}
BkfmWorkFlowNodePermisRole.prototype.getRoleId = function(){
	return this.bkfmWorkFlowNodePermisRole.get("ROLE_ID");
}
BkfmWorkFlowNodePermisRole.prototype.setRoleId = function(role_id){
	this.bkfmWorkFlowNodePermisRole.set("ROLE_ID",role_id);
}
BkfmWorkFlowNodePermisRole.prototype.getRoleName = function(){
	return this.bkfmWorkFlowNodePermisRole.get("ROLE_NAME");
}
BkfmWorkFlowNodePermisRole.prototype.setRoleName = function(role_name){
	this.bkfmWorkFlowNodePermisRole.set("ROLE_NAME",role_name);
}
BkfmWorkFlowNodePermisRole.prototype.getNodeCode = function(){
	return this.bkfmWorkFlowNodePermisRole.get("NODE_CODE");
}
BkfmWorkFlowNodePermisRole.prototype.setNodeCode = function(node_code){
	this.bkfmWorkFlowNodePermisRole.set("NODE_CODE",node_code);
}
BkfmWorkFlowNodePermisRole.prototype.getNodeName = function(){
	return this.bkfmWorkFlowNodePermisRole.get("NODE_NAME");
}
BkfmWorkFlowNodePermisRole.prototype.setNodeName = function(node_name){
	this.bkfmWorkFlowNodePermisRole.set("NODE_NAME",node_name);
}
BkfmWorkFlowNodePermisRole.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNodePermisRole.get("WORKFLOW_CODE");
}
BkfmWorkFlowNodePermisRole.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNodePermisRole.set("WORKFLOW_CODE",workflow_code);
}
BkfmWorkFlowNodePermisRole.prototype.getWorkFlowName = function(){
	return this.bkfmWorkFlowNodePermisRole.get("WORKFLOW_NAME");
}
BkfmWorkFlowNodePermisRole.prototype.setWorkFlowName = function(workflow_name){
	return this.bkfmWorkFlowNodePermisRole.set("WORKFLOW_NAME",workflow_name);
}

/**
 * 节点部门权限列表
 * @returns
 */
function BkfmWorkFlowNodePermisDepts(){
	var bkfmWorkFlowNodePermisDepts = new Array();
	this.bkfmWorkFlowNodePermisDepts = bkfmWorkFlowNodePermisDepts;
}
BkfmWorkFlowNodePermisDepts.prototype.getBkfmWorkFlowNodePermisDepts = function(){
	return this.bkfmWorkFlowNodePermisDepts;
}
/**
 * 根据节点编码获取节点对应的部门权限
 */
BkfmWorkFlowNodePermisDepts.prototype.getBkfmWorkFlowNodePermisDeptsByNodeCode = function(node_code){
	var workFlowNodePermisDepts = new Array();
	this.bkfmWorkFlowNodePermisDepts.forEach(function (item,index,owner){
		if(item.getNodeCode() == node_code){
			workFlowNodePermisDepts.push(item);
		}
	});
	return workFlowNodePermisDepts;
}
/**
 * 添加节点部门到部门权限列表中
 */
BkfmWorkFlowNodePermisDepts.prototype.addBkfmWorkFlowNodePermisDept = function(bkfmWorkFlowNodePermisDept){
	this.bkfmWorkFlowNodePermisDepts.push(bkfmWorkFlowNodePermisDept);
}
/**
 * 根据部门编码和流程节点判断当前部门是否在指定节点中存在
 */
BkfmWorkFlowNodePermisDepts.prototype.hasExistsDept = function(org_id,node_code){
	var bool = false;
	this.bkfmWorkFlowNodePermisDepts.forEach(function (item,index,owner){
		if(item.getOrgId() == org_id && item.getNodeCode() == node_code){
			bool = true;
			return false;
		}
	});
	return bool;
}
/**
 * 根据部门编码和节点编码查询对应的部门权限对象
 */
BkfmWorkFlowNodePermisDepts.prototype.getBkfmWorkFlowNodePermisDept = function(org_id,node_code){
	var bkfmWorkFlowNodePermisDept = null;
	this.bkfmWorkFlowNodePermisDepts.forEach(function (item,index,owner){
		if(item.getOrgId() == org_id){
			bkfmWorkFlowNodePermisDept = item;
			return false;
		}
	});
	return bkfmWorkFlowNodePermisDept;
}
/**
 * 根据部门编码删除用户权限对象
 */
BkfmWorkFlowNodePermisDepts.prototype.removeBkfmWorkFlowNodePermisDept = function(org_id,node_code){
	for(i in this.bkfmWorkFlowNodePermisDepts){
		var oldBkfmWorkFlowNodePermisDept = this.bkfmWorkFlowNodePermisDepts[i];
		if(oldBkfmWorkFlowNodePermisDept.getOrgId() == org_id && oldBkfmWorkFlowNodePermisDept.getNodeCode() == node_code){
			this.bkfmWorkFlowNodePermisDepts.splice(i,1);
			break;
		}
	}
}
/**
 * 节点部门权限对象
 * @returns
 */
function BkfmWorkFlowNodePermisDept(){
	var bkfmWorkFlowNodePermisDept = new Map();
	bkfmWorkFlowNodePermisDept.set("RWID",Utils.getRwid());
	bkfmWorkFlowNodePermisDept.set("ORG_ID",null);
	bkfmWorkFlowNodePermisDept.set("ORG_NAME",null);
	bkfmWorkFlowNodePermisDept.set("NODE_CODE",null);
	bkfmWorkFlowNodePermisDept.set("NODE_NAME",null);
	bkfmWorkFlowNodePermisDept.set("WORKFLOW_CODE",null);
	bkfmWorkFlowNodePermisDept.set("WORKFLOW_NAME",null);
	
	this.bkfmWorkFlowNodePermisDept = bkfmWorkFlowNodePermisDept;
}
BkfmWorkFlowNodePermisDept.prototype.getRwid = function(){
	return this.bkfmWorkFlowNodePermisDept.get("RWID");
}
BkfmWorkFlowNodePermisDept.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowNodePermisDept.set("RWID",rwid);
}
BkfmWorkFlowNodePermisDept.prototype.getOrgId = function(){
	return this.bkfmWorkFlowNodePermisDept.get("ORG_ID");
}
BkfmWorkFlowNodePermisDept.prototype.setOrgId = function(org_id){
	this.bkfmWorkFlowNodePermisDept.set("ORG_ID",org_id);
}
BkfmWorkFlowNodePermisDept.prototype.getOrgName = function(){
	return this.bkfmWorkFlowNodePermisDept.get("ORG_NAME");
}
BkfmWorkFlowNodePermisDept.prototype.setOrgName = function(org_name){
	this.bkfmWorkFlowNodePermisDept.set("ORG_NAME",org_name);
}
BkfmWorkFlowNodePermisDept.prototype.getNodeCode = function(){
	return this.bkfmWorkFlowNodePermisDept.get("NODE_CODE");
}
BkfmWorkFlowNodePermisDept.prototype.setNodeCode = function(node_code){
	this.bkfmWorkFlowNodePermisDept.set("NODE_CODE",node_code);
}
BkfmWorkFlowNodePermisDept.prototype.getNodeName = function(){
	return this.bkfmWorkFlowNodePermisDept.get("NODE_NAME");
}
BkfmWorkFlowNodePermisDept.prototype.setNodeName = function(node_name){
	this.bkfmWorkFlowNodePermisDept.set("NODE_NAME",node_name);
}
BkfmWorkFlowNodePermisDept.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowNodePermisDept.get("WORKFLOW_CODE");
}
BkfmWorkFlowNodePermisDept.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowNodePermisDept.set("WORKFLOW_CODE",workflow_code);
}
BkfmWorkFlowNodePermisDept.prototype.getWorkFlowName = function(){
	return this.bkfmWorkFlowNodePermisDept.get("WORKFLOW_NAME");
}
BkfmWorkFlowNodePermisDept.prototype.setWorkFlowName = function(workflow_name){
	this.bkfmWorkFlowNodePermisDept.set("WORKFLOW_NAME",workflow_name);
}

















/**
 * 工作流程所使用的表
 * @returns
 */
function BkfmWorkFlowTables(){
	var bkfmWorkFlowTables = new Array();
	
	this.bkfmWorkFlowTables = bkfmWorkFlowTables;
};
/**
 * 获取流程对应的表
 */
BkfmWorkFlowTables.prototype.getWorkFlowTables = function(){
	return this.bkfmWorkFlowTables;
};
/**
 * 根据业务表路径查询业务表对象
 * @param table_path 业务表路径
 */
BkfmWorkFlowTables.prototype.getWorkFlowTable = function(table_path){
	for(i in this.bkfmWorkFlowTables){
		var workFlowTable = this.bkfmWorkFlowTables[i];
		if(table_path == workFlowTable.getTablePath()){
			return workFlowTable;
		}
	}
	return null;
};
/**
 * 判断是否已经配置了主表
 */
BkfmWorkFlowTables.prototype.hashExistsMainTable = function(){
	var bool = false;
	for(i in this.bkfmWorkFlowTables){
		var workFlowTable = this.bkfmWorkFlowTables[i];
		if(workFlowTable.getTableType() == workFlowTable.MAINTABLE_CODE){
			bool = true;
			break;
		}
	}
	return bool;
}

/**
 * 添加表对象,返回最新的业务表列表
 * @param workFlowTable BkfmWorkFlowTable
 */
BkfmWorkFlowTables.prototype.addWorkFlowTable = function(workFlowTable){
	this.bkfmWorkFlowTables.push(workFlowTable);
	//返回最新的业务表列表
	return this.bkfmWorkFlowTables;
};


/**
 * 根据form_path表路径，更新对应的表对象信息
 * 返回最新的业务表列表
 * @param form_path 业务表路径
 * @param workFlowTable BkfmWorkFlowTable
 */
BkfmWorkFlowTables.prototype.updateWorkFlowTable = function(form_path,workFlowTable){
	for(i in this.bkfmWorkFlowTables){
		var oldWorkFlowTable = this.bkfmWorkFlowTables[i];
		if(oldWorkFlowTable.getFormPath() == workFlowTable.getFormPath()){
			this.bkfmWorkFlowTables[i] = workFlowTable;
			break;
		}
	}
	//返回最新的业务表列表
	return this.bkfmWorkFlowTables;
};
/**
 * 工作流表对象
 * @param rwid指定表对象的唯一编码
 * @returns
 */
function BkfmWorkFlowTable(){
	var workFlowTable = new Map();
	workFlowTable.set("RWID",Utils.getRwid());
	//流程编码
	workFlowTable.set("WORKFLOW_CODE",null);
	//流程名称
	workFlowTable.set("WORKFLOW_NAME",null);
	//所属表路径
	workFlowTable.set("TABLE_PATH",null);
	//表名
	workFlowTable.set("TABLE_NAME",null);
	//业务表类型0	主表;1	明细表
	workFlowTable.set("TABLE_TYPE",null);
	//业务表类型名称
	workFlowTable.set("TABLE_TYPE_NAME",null);
	
	this.workFlowTable = workFlowTable;
};
//主表
BkfmWorkFlowTable.prototype.MAINTABLE_CODE = 0;
BkfmWorkFlowTable.prototype.MAINTABLE_NAME = "主表";
//字表
BkfmWorkFlowTable.prototype.SCHEDULETABLE_CODE = 1;
BkfmWorkFlowTable.prototype.SCHEDULETABLE_NAME = "明细表";

BkfmWorkFlowTable.prototype.getRwid = function(){
	return this.workFlowTable.get("RWID");
};
BkfmWorkFlowTable.prototype.setRwid = function(rwid){
	this.workFlowTable.set("RWID",rwid);
};
BkfmWorkFlowTable.prototype.getWorkFlowCode = function(){
	return this.workFlowTable.get("WORKFLOW_CODE");
};
BkfmWorkFlowTable.prototype.setWorkFlowCode = function(workFlowCode){
	this.workFlowTable.set("WORKFLOW_CODE",workFlowCode);
};
BkfmWorkFlowTable.prototype.getWorkFlowName = function(){
	return this.workFlowTable.get("WORKFLOW_NAME");
}
BkfmWorkFlowTable.prototype.setWorkFlowName = function(workflow_name){
	this.workFlowTable.set("WORKFLOW_NAME",workflow_name);
}
BkfmWorkFlowTable.prototype.getTablePath = function(){
	return this.workFlowTable.get("TABLE_PATH");
};
BkfmWorkFlowTable.prototype.setTablePath = function(table_path){
	this.workFlowTable.set("TABLE_PATH",table_path);
};
BkfmWorkFlowTable.prototype.getTableName = function(){
	return this.workFlowTable.get("TABLE_NAME");
}
BkfmWorkFlowTable.prototype.setTableName = function(table_name){
	this.workFlowTable.set("TABLE_NAME",table_name);
}
BkfmWorkFlowTable.prototype.getTableType = function(){
	return this.workFlowTable.get("TABLE_TYPE");
}
BkfmWorkFlowTable.prototype.setTableType = function(table_type){
	this.workFlowTable.set("TABLE_TYPE",table_type)
}
BkfmWorkFlowTable.prototype.getTableTypeName = function(){
	return this.workFlowTable.get("TABLE_TYPE_NAME");
}
BkfmWorkFlowTable.prototype.setTableTypeName = function(table_type_name){
	this.workFlowTable.set("TABLE_TYPE_NAME",table_type_name);
}


//流程表单
function BkfmWorkFlowForms(){
	var bkfmWorkFlowForms = new Array();
	this.bkfmWorkFlowForms = bkfmWorkFlowForms;
}
BkfmWorkFlowForms.prototype.getBkfmWorkFlowForms = function(){
	return this.bkfmWorkFlowForms;
}
BkfmWorkFlowForms.prototype.addBkfmWorkFlowForm = function(bkfmWorkFlowForm){
	this.bkfmWorkFlowForms.push(bkfmWorkFlowForm);
}
BkfmWorkFlowForms.prototype.updateBkfmWorkFlowForm = function(bkfmWorkFlowForm){
	for(i in this.bkfmWorkFlowForms){
		var oldBkfmWorkFlowForm = this.bkfmWorkFlowForms[i];
		if(oldBkfmWorkFlowForm.getWorkFlowFormName() == bkfmWorkFlowForm.getWorkFlowFormName()){
			this.bkfmWorkFlowForms[i] = bkfmWorkFlowForm;
			break;
		}
	}
}
/**
 * 根据表单名称获取表单对象
 */
BkfmWorkFlowForms.prototype.getBkfmWorkFlowForm = function(workflow_form_name){
	var workFlowForm = null;
	for(i in this.bkfmWorkFlowForms){
		var oldBkfmWorkFlowForm = this.bkfmWorkFlowForms[i];
		if(oldBkfmWorkFlowForm.getWorkFlowFormName() == workflow_form_name){
			workFlowForm = this.bkfmWorkFlowForms[i];
			break;
		}
	}
	return workFlowForm;
}
BkfmWorkFlowForms.prototype.hasExistsWorkFlowForm = function(workflow_form_name){
	var bool = false;
	for(i in this.bkfmWorkFlowForms){
		var bkfmWorkFlowForm = this.bkfmWorkFlowForms[i];
		if(bkfmWorkFlowForm.getWorkFlowFormName() == workflow_form_name){
			bool = true;
			break;
		}
	}
	return bool;
}
BkfmWorkFlowForms.prototype.removeBkfmWorkFlowForm = function(workflow_form_name){
	for(i in this.bkfmWorkFlowForms){
		var oldBkfmWorkFlowForm = this.bkfmWorkFlowForms[i];
		if(oldBkfmWorkFlowForm.getWorkFlowFormName() == workflow_form_name){
			this.bkfmWorkFlowForms.splice(i,1);
			break;
		}
	}
}
/**
 * 流程表单对象
 * @returns
 */
function BkfmWorkFlowForm(){
	var bkfmWorkFlowForm = new Map();
	bkfmWorkFlowForm.set("RWID",Utils.getRwid());
	//工作流编码
	bkfmWorkFlowForm.set("WORKFLOW_CODE",null);
	//流程名称
	bkfmWorkFlowForm.set("WORKFLOW_NAME",null);
	//流程表单名称
	bkfmWorkFlowForm.set("WORKFLOW_FORM_NAME",null);
	//初始化表单页面配置项列表
	bkfmWorkFlowForm.set("WORKFLOW_FORM_PAGEITEMS",new BkfmWorkFlowFormPageItems());
	this.bkfmWorkFlowForm = bkfmWorkFlowForm;
}
BkfmWorkFlowForm.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowForm.set("RWID",rwid);
}
BkfmWorkFlowForm.prototype.getRwid = function(){
	return this.bkfmWorkFlowForm.get("RWID");
}
BkfmWorkFlowForm.prototype.setWorkFlowCode = function(workflow_code){
	this.bkfmWorkFlowForm.set("WORKFLOW_CODE",workflow_code);
}
BkfmWorkFlowForm.prototype.getWorkFlowCode = function(){
	return this.bkfmWorkFlowForm.get("WORKFLOW_CODE");
}
BkfmWorkFlowForm.prototype.setWorkFlowName = function(workflow_name){
	this.bkfmWorkFlowForm.set("WORKFLOW_NAME",workflow_name);
}
BkfmWorkFlowForm.prototype.getWorkFlowName = function(){
	return this.bkfmWorkFlowForm.get("WORKFLOW_NAME");
}
BkfmWorkFlowForm.prototype.setWorkFlowFormName = function(workflow_form_name){
	this.bkfmWorkFlowForm.set("WORKFLOW_FORM_NAME",workflow_form_name);
}
BkfmWorkFlowForm.prototype.getWorkFlowFormName = function(){
	return this.bkfmWorkFlowForm.get("WORKFLOW_FORM_NAME");
}
BkfmWorkFlowForm.prototype.setWorkFlowFormPageItems = function(workflow_form_pageitems){
	this.bkfmWorkFlowForm.set("WORKFLOW_FORM_PAGEITEMS",workflow_form_pageitems);
}
BkfmWorkFlowForm.prototype.getWorkFlowFormPageItems = function(){
	return this.bkfmWorkFlowForm.get("WORKFLOW_FORM_PAGEITEMS");
}
//自动排序表单设计页面配置项的顺序
BkfmWorkFlowForm.prototype.sortForm = function(){
	var bkfmWorkFlowFormPageItems = this.getWorkFlowFormPageItems().getBkfmWorkFlowFormPageItems();
	for(i in bkfmWorkFlowFormPageItems){
		var bkfmWorkFlowFormPageItem = bkfmWorkFlowFormPageItems[i];
		bkfmWorkFlowFormPageItem.setOrderBy(i);
	}
}



//表单页面配置项列表
function BkfmWorkFlowFormPageItems(){
	var bkfmWorkFlowFormPageItems = new Array();
	this.bkfmWorkFlowFormPageItems = bkfmWorkFlowFormPageItems;
}
BkfmWorkFlowFormPageItems.prototype.getBkfmWorkFlowFormPageItems = function(){
	return this.bkfmWorkFlowFormPageItems;
}
BkfmWorkFlowFormPageItems.prototype.addBkfmWorkFlowFormPageItem = function(bkfmWorkFlowFormPageItem){
	this.bkfmWorkFlowFormPageItems.push(bkfmWorkFlowFormPageItem);
}
/**
 * 根据业务表路径获取表单配置项对象
 */
BkfmWorkFlowFormPageItems.prototype.getBkfmWorkFlowFormPageItem = function(table_path){
	for(i in this.bkfmWorkFlowFormPageItems){
		var bkfmWorkFlowFormPageItem = this.bkfmWorkFlowFormPageItems[i];
		
	}
}
/**
 * 重新设置配置项
 */
BkfmWorkFlowFormPageItems.prototype.setBkfmWorkFlowFormPageItem = function(table_path,bkfmWorkFlowFormPageItem){
	for(i in this.bkfmWorkFlowFormPageItems){
		var bkfmWorkFlowFormPageItem = this.bkfmWorkFlowFormPageItems[i];
		if(bkfmWorkFlowFormPageItem.getTablePath()==table_path){
			this.bkfmWorkFlowFormPageItems[i] = bkfmWorkFlowFormPageItem;
		}
		
	}
}
/**
 * 根据表单页面名称获取表单页面的配置项列表
 */
BkfmWorkFlowFormPageItems.prototype.getBkfmWorkFlowFormPageItemsByWorkFlowFormName = function(workflow_form_name){
	var pageItems = new Array();
	for(i in this.bkfmWorkFlowFormPageItems){
		var bkfmWorkFlowFormPageItem = this.bkfmWorkFlowFormPageItems[i];
		if(bkfmWorkFlowFormPageItem.getWorkFlowFormName() == workflow_form_name){
			pageItems.push(bkfmWorkFlowFormPageItem);
		}
	}
	return pageItems;
}
/**
 * 删除指定的表单页面配置项,根据页面配置项业务表路径和表单名称
 */
BkfmWorkFlowFormPageItems.prototype.removeBkfmWorkFlowFormPageItem = function(workflow_form_name,table_path){
	for(i in this.bkfmWorkFlowFormPageItems){
		var bkfmWorkFlowFormPageItem = this.bkfmWorkFlowFormPageItems[i];
		if(bkfmWorkFlowFormPageItem.getWorkFlowFormName() == workflow_form_name && bkfmWorkFlowFormPageItem.getTablePath() == table_path){
			this.bkfmWorkFlowFormPageItems.splice(i,1);
		}
	}
}

//表单页面配置项对象
function BkfmWorkFlowFormPageItem(){
	var bkfmWorkFlowFormPageItem = new Map();
	//设置唯一编码
	bkfmWorkFlowFormPageItem.set("RWID",Utils.getRwid());
	//所属表单名称
	bkfmWorkFlowFormPageItem.set("WORKFLOW_FORM_NAME",null);
	//页面配置项类型编码
	bkfmWorkFlowFormPageItem.set("PAGEITEM_TYPE",null);
	//页面配置项类型名称
	bkfmWorkFlowFormPageItem.set("PAGEITEM_TYPE_NAME",null);
	//页面配置项标题
	bkfmWorkFlowFormPageItem.set("PAGEITEM_TITLE",null);
	//所属业务表路径
	bkfmWorkFlowFormPageItem.set("TABLE_PATH",null);
	//所属业务表名称
	bkfmWorkFlowFormPageItem.set("TABLE_NAME",null);
	//排序
	bkfmWorkFlowFormPageItem.set("ORDER_BY",0);
	//表单每行显示列数,默认每行显示4列
	bkfmWorkFlowFormPageItem.set("PAGEITEM_FORM_COLUMNCOUNT",null);
	//设置元素高度,默认250
	bkfmWorkFlowFormPageItem.set("PAGEITEM_HEIGHT",250);
	//是否允许保存,默认允许保存
	bkfmWorkFlowFormPageItem.set("IS_SAVE",Constants.NO);
	//是否允许新增
	bkfmWorkFlowFormPageItem.set("IS_ADD",Constants.NO);
	//是否允许编辑
	bkfmWorkFlowFormPageItem.set("IS_EDIT",Constants.NO);
	//是否允许删除
	bkfmWorkFlowFormPageItem.set("IS_DELETE",Constants.NO);
	//设置只读字段列表
	bkfmWorkFlowFormPageItem.set("READONLYFIELDS",new BkfmWorkFlowFormPageItemReadOnlyFields());
	//设置隐藏字段
	bkfmWorkFlowFormPageItem.set("HIDDENFIELDS",new BkfmWorkFlowFormPageItemHiddenFields());
	
	this.bkfmWorkFlowFormPageItem = bkfmWorkFlowFormPageItem;
}
//表单配置项编码
BkfmWorkFlowFormPageItem.prototype.PAGEITEM_TYPE_FORM_CODE = "FORM";
//表单配置项名称
BkfmWorkFlowFormPageItem.prototype.PAGEITEM_TYPE_FORM_NAME = "表单";
//表单默认显示4列
BkfmWorkFlowFormPageItem.prototype.DEFAULT_FORM_COLUMNCOUNT = 4;
//表格配置项编码
BkfmWorkFlowFormPageItem.prototype.PAGEITEM_TYPE_GRID_CODE = "GRID";
//表格配置项名称
BkfmWorkFlowFormPageItem.prototype.PAGEITEM_TYPE_GRID_NAME = "表格";
/**
 * 获取唯一组建
 */
BkfmWorkFlowFormPageItem.prototype.getRwid = function(){
	return this.bkfmWorkFlowFormPageItem.get("RWID");
}
BkfmWorkFlowFormPageItem.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowFormPageItem.set("RWID",rwid);
}
BkfmWorkFlowFormPageItem.prototype.getWorkFlowFormName = function(){
	return this.bkfmWorkFlowFormPageItem.get("WORKFLOW_FORM_NAME");
}
BkfmWorkFlowFormPageItem.prototype.setWorkFlowFormName = function(workflow_form_name){
	this.bkfmWorkFlowFormPageItem.set("WORKFLOW_FORM_NAME",workflow_form_name);
}
BkfmWorkFlowFormPageItem.prototype.getPageItemType = function(){
	return this.bkfmWorkFlowFormPageItem.get("PAGEITEM_TYPE");
}
BkfmWorkFlowFormPageItem.prototype.setPageItemType = function(pageitem_type){
	this.bkfmWorkFlowFormPageItem.set("PAGEITEM_TYPE",pageitem_type);
}
BkfmWorkFlowFormPageItem.prototype.getPageTypeName = function(){
	return this.bkfmWorkFlowFormPageItem.get("PAGEITEM_TYPE_NAME");
}
BkfmWorkFlowFormPageItem.prototype.setPageTypeName = function(pageitem_type_name){
	this.bkfmWorkFlowFormPageItem.set("PAGEITEM_TYPE_NAME",pageitem_type_name);
}
BkfmWorkFlowFormPageItem.prototype.getPageTitle = function(){
	return this.bkfmWorkFlowFormPageItem.get("PAGEITEM_TITLE");
}
BkfmWorkFlowFormPageItem.prototype.setPageTitle = function(pageitem_title){
	this.bkfmWorkFlowFormPageItem.set("PAGEITEM_TITLE",pageitem_title);
}
BkfmWorkFlowFormPageItem.prototype.getTablePath = function(){
	return this.bkfmWorkFlowFormPageItem.get("TABLE_PATH");
}
BkfmWorkFlowFormPageItem.prototype.setTablePath = function(table_path){
	this.bkfmWorkFlowFormPageItem.set("TABLE_PATH",table_path);
}
BkfmWorkFlowFormPageItem.prototype.getTableName = function(){
	return this.bkfmWorkFlowFormPageItem.get("TABLE_NAME");
}
BkfmWorkFlowFormPageItem.prototype.setTableName = function(table_name){
	this.bkfmWorkFlowFormPageItem.set("TABLE_NAME",table_name);
}
BkfmWorkFlowFormPageItem.prototype.getOrderBy = function(){
	return this.bkfmWorkFlowFormPageItem.get("ORDER_BY");
}
BkfmWorkFlowFormPageItem.prototype.setOrderBy = function(order_by){
	this.bkfmWorkFlowFormPageItem.set("ORDER_BY",order_by);
}
BkfmWorkFlowFormPageItem.prototype.getPageItemFormColumnCount = function(){
	return this.bkfmWorkFlowFormPageItem.get("PAGEITEM_FORM_COLUMNCOUNT");
}
BkfmWorkFlowFormPageItem.prototype.setPageItemFormColumnCount = function(pageitem_form_columncount){
	this.bkfmWorkFlowFormPageItem.set("PAGEITEM_FORM_COLUMNCOUNT",pageitem_form_columncount);
}
BkfmWorkFlowFormPageItem.prototype.setPageItemHeight = function(pageitem_height){
	this.bkfmWorkFlowFormPageItem.set("PAGEITEM_HEIGHT",pageitem_height);
}
BkfmWorkFlowFormPageItem.prototype.getPageItemHeight = function(){
	return this.bkfmWorkFlowFormPageItem.get("PAGEITEM_HEIGHT");
}
BkfmWorkFlowFormPageItem.prototype.getIsSave = function(){
	return this.bkfmWorkFlowFormPageItem.get("IS_SAVE");
}
BkfmWorkFlowFormPageItem.prototype.setIsSave = function(is_save){
	this.bkfmWorkFlowFormPageItem.set("IS_SAVE",is_save);
}
BkfmWorkFlowFormPageItem.prototype.getIsAdd = function(){
	return this.bkfmWorkFlowFormPageItem.get("IS_ADD");
}
BkfmWorkFlowFormPageItem.prototype.setIsAdd = function(is_add){
	this.bkfmWorkFlowFormPageItem.set("IS_ADD",is_add);
}
BkfmWorkFlowFormPageItem.prototype.getIsEdit = function(){
	return this.bkfmWorkFlowFormPageItem.get("IS_EDIT");
}
BkfmWorkFlowFormPageItem.prototype.setIsEdit = function(is_edit){
	this.bkfmWorkFlowFormPageItem.set("IS_EDIT",is_edit);
}
BkfmWorkFlowFormPageItem.prototype.getIsDelete = function(){
	return this.bkfmWorkFlowFormPageItem.get("IS_DELETE");
}
BkfmWorkFlowFormPageItem.prototype.setIsDelete = function(is_delete){
	this.bkfmWorkFlowFormPageItem.set("IS_DELETE",is_delete);
}
BkfmWorkFlowFormPageItem.prototype.setBkfmWorkFlowFormPageItemReadOnlyFields = function(bkfmWorkFlowFormPageItemReadOnlyFields){
	this.bkfmWorkFlowFormPageItem.set("READONLYFIELDS",bkfmWorkFlowFormPageItemReadOnlyFields);
}
BkfmWorkFlowFormPageItem.prototype.getBkfmWorkFlowFormPageItemReadOnlyFields = function(){
	return this.bkfmWorkFlowFormPageItem.get("READONLYFIELDS");
}
BkfmWorkFlowFormPageItem.prototype.setBkfmWorkFlowFormPageItemHiddenFields = function(bkfmWorkFlowFormPageItemHiddenFields){
	this.bkfmWorkFlowFormPageItem.set("HIDDENFIELDS",bkfmWorkFlowFormPageItemHiddenFields);
}
BkfmWorkFlowFormPageItem.prototype.getBkfmWorkFlowFormPageItemHiddenFields = function(){
	return this.bkfmWorkFlowFormPageItem.get("HIDDENFIELDS");
}

/**
 * 表单页面配置项只读字段列表
 * @returns
 */
function BkfmWorkFlowFormPageItemReadOnlyFields(){
	var bkfmWorkFlowFormPageItemReadOnlyFields = new Array();
	this.bkfmWorkFlowFormPageItemReadOnlyFields = bkfmWorkFlowFormPageItemReadOnlyFields;
}
/**
 * 获取所有只读字段
 */
BkfmWorkFlowFormPageItemReadOnlyFields.prototype.getBkfmWorkFlowFormPageItemReadOnlyFields = function(){
	return this.bkfmWorkFlowFormPageItemReadOnlyFields;
}
/**
 * 添加只读字段
 */
BkfmWorkFlowFormPageItemReadOnlyFields.prototype.addBkfmWorkFlowFormPageItemReadOnlyField = function(bkfmWorkFlowFormPageItemReadOnlyField){
	this.bkfmWorkFlowFormPageItemReadOnlyFields.push(bkfmWorkFlowFormPageItemReadOnlyField);
}
/**
 * 删除所有的只读字段
 */
BkfmWorkFlowFormPageItemReadOnlyFields.prototype.removeAll = function(){
	this.bkfmWorkFlowFormPageItemReadOnlyFields.splice(0,this.bkfmWorkFlowFormPageItemReadOnlyFields.length);
}

/**
 * 表单页面配置项只读字段
 * @returns
 */
function BkfmWorkFlowFormPageItemReadOnlyField(){
	var bkfmWorkFlowFormPageItemReadOnlyField = new Map();
	bkfmWorkFlowFormPageItemReadOnlyField.set("RWID",Utils.getRwid());
	//字段
	bkfmWorkFlowFormPageItemReadOnlyField.set("FIELD_ID",null);
	//字段名称
	bkfmWorkFlowFormPageItemReadOnlyField.set("FIELD_NAME",null);
	
	this.bkfmWorkFlowFormPageItemReadOnlyField = bkfmWorkFlowFormPageItemReadOnlyField;
}
BkfmWorkFlowFormPageItemReadOnlyField.prototype.getRwid = function(){
	return this.bkfmWorkFlowFormPageItemReadOnlyField.get("RWID");
}
BkfmWorkFlowFormPageItemReadOnlyField.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowFormPageItemReadOnlyField.set("RWID",rwid);
}
BkfmWorkFlowFormPageItemReadOnlyField.prototype.getFieldId = function(){
	return this.bkfmWorkFlowFormPageItemReadOnlyField.get("FIELD_ID");
}
BkfmWorkFlowFormPageItemReadOnlyField.prototype.setFieldId = function(field_id){
	this.bkfmWorkFlowFormPageItemReadOnlyField.set("FIELD_ID",field_id);
}
BkfmWorkFlowFormPageItemReadOnlyField.prototype.getFieldName = function(){
	return this.bkfmWorkFlowFormPageItemReadOnlyField.get("FIELD_NAME");
}
BkfmWorkFlowFormPageItemReadOnlyField.prototype.setFieldName = function(field_name){
	this.bkfmWorkFlowFormPageItemReadOnlyField.set("FIELD_NAME",field_name);
}


/**
 * 隐藏字段列表
 * @returns
 */
function BkfmWorkFlowFormPageItemHiddenFields(){
	var bkfmWorkFlowFormPageItemHiddenFields = new Array();
	this.bkfmWorkFlowFormPageItemHiddenFields = bkfmWorkFlowFormPageItemHiddenFields;
}
/**
 * 获取所有只读字段
 */
BkfmWorkFlowFormPageItemHiddenFields.prototype.getBkfmWorkFlowFormPageItemHiddenFields = function(){
	return this.bkfmWorkFlowFormPageItemHiddenFields;
}
/**
 * 添加只读字段
 */
BkfmWorkFlowFormPageItemHiddenFields.prototype.addBkfmWorkFlowFormPageItemHiddenField = function(bkfmWorkFlowFormPageItemHiddenField){
	this.bkfmWorkFlowFormPageItemHiddenFields.push(bkfmWorkFlowFormPageItemHiddenField);
}
/**
 * 删除所有的只读字段
 */
BkfmWorkFlowFormPageItemHiddenFields.prototype.removeAll = function(){
	this.bkfmWorkFlowFormPageItemHiddenFields.splice(0,this.bkfmWorkFlowFormPageItemHiddenFields.length);
}

function BkfmWorkFlowFormPageItemHiddenField(){
	var bkfmWorkFlowFormPageItemHiddenField = new Map();
	
	bkfmWorkFlowFormPageItemHiddenField.set("RWID",Utils.getRwid());
	//字段
	bkfmWorkFlowFormPageItemHiddenField.set("FIELD_ID",null);
	//字段名称
	bkfmWorkFlowFormPageItemHiddenField.set("FIELD_NAME",null);
	
	this.bkfmWorkFlowFormPageItemHiddenField = bkfmWorkFlowFormPageItemHiddenField;
}
BkfmWorkFlowFormPageItemHiddenField.prototype.getRwid = function(){
	return this.bkfmWorkFlowFormPageItemHiddenField.get("RWID");
}
BkfmWorkFlowFormPageItemHiddenField.prototype.setRwid = function(rwid){
	this.bkfmWorkFlowFormPageItemHiddenField.set("RWID",rwid);
}
BkfmWorkFlowFormPageItemHiddenField.prototype.getFieldId = function(){
	return this.bkfmWorkFlowFormPageItemHiddenField.get("FIELD_ID");
}
BkfmWorkFlowFormPageItemHiddenField.prototype.setFieldId = function(field_id){
	this.bkfmWorkFlowFormPageItemHiddenField.set("FIELD_ID",field_id);
}
BkfmWorkFlowFormPageItemHiddenField.prototype.getFieldName = function(){
	return this.bkfmWorkFlowFormPageItemHiddenField.get("FIELD_NAME");
}
BkfmWorkFlowFormPageItemHiddenField.prototype.setFieldName = function(field_name){
	this.bkfmWorkFlowFormPageItemHiddenField.set("FIELD_NAME",field_name);
}









